﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using VisionRoc.Tool;

namespace VisionRoc_Measure
{
    public partial class FormAppName : Form
    {
        public FormAppName()
        {
            InitializeComponent();
        }

        private void FormAppName_FormClosing(object sender, FormClosingEventArgs e)
        {
            DialogResult res = MessageBox.Show("是否保存当前数据？", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
            if (res == DialogResult.OK)  //1为确定，2为取消,...
            {
                try
                {
                    Tool.WriteAppName(textBox1.Text);
                    Tool.AppName = textBox1.Text;
                    MessageBox.Show("保存数据成功");
                }
                catch { MessageBox.Show("保存失败！"); }
            }
        }
    }
}
